<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:import url="header.jsp"/>
<section id="container" class="">
    <c:import url="left.jsp"/>
    <section id="main-content">
        <!-- 这里加其他页面 -->
        <h1>这里是内容区域</h1>
        <h1>这里是内容区域1</h1>
        <h1>这里是内容区域2</h1>
        <h1>这里是内容区域3</h1>
        <h1>这里是内容区域4</h1>
    </section>
    <%@include file="../footer.jsp" %>
</section>
<script type="text/javascript" charset="utf-8">
    var content = "${content}";
    if (content) {
        loadContent(content);
    }

    // 加载内容区域
    function loadContent(content) {
        console.log(content);
        window.location.hash = content;
        window.onhashchange = function () {
            content = window.location.hash.substr(1);
            $.get(content, function (data) {
                $("#main-content").html(data);
            }, "text");
            console.log(content + " 加载完毕！");
        };
    }
</script>